package com.lebang.mapper;

import com.lebang.configuration.datasource.DataSource;
import com.lebang.domain.MemberCashWithdrawal;
import com.lebang.entity.member.LbbMemberTrade;
import com.lebang.example.MemberCashWithdrawalExample;
import com.lebang.model.cences.IdentityCardCount;
import com.lebang.model.statistics.StatisticsRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * MemberCashWithdrawalMapper继承基类
 */
@Mapper
public interface MemberCashWithdrawalMapper extends MyBatisBaseDao<MemberCashWithdrawal, Long, MemberCashWithdrawalExample> {
    @DataSource("commonDB")
    String selectAddrByCode(String code);

    List<Map<String,String>> page(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end,
                                  @Param("page") Integer page, @Param("limit") Integer limit,
                                  @Param("phone") String phone, @Param("checkStatus") Integer checkStatus,
                                  @Param("method") Integer method, @Param("icrad") String icrad,
                                  @Param("realName") String realName, @Param("imei") String imei);

    Integer allow(String memberId);

    long count(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end,
               @Param("phone") String phone, @Param("checkStatus") Integer checkStatus,
               @Param("method") Integer method, @Param("icrad") String icrad,
               @Param("realName") String realName, @Param("imei") String imei);

    BigDecimal todayAllCashMoney(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    BigDecimal todayCreatCashMoney(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    List<LbbMemberTrade> selectByMemberId(String userid);

    Integer selectByStatusAndMemberId(@Param("memberId") String memberId, @Param("index") int index);

    List<IdentityCardCount> selectByDate(@Param("star") LocalDate star, @Param("end") LocalDate end);

    Integer getTotal(@Param("star") LocalDate starTime,@Param("end") LocalDate endTime);
    @DataSource("commonDB")
    Integer selectById(@Param("s") String s);
    @DataSource("commonDB")
    void updateByCode(@Param("code") String code, @Param("c") String c);

    int countByStatus(@Param("memberId") String memberId);

    void checkMemberAllRecord(@Param("memberId") String memberId);

    void updateByMemberId(@Param("memberId") String memberId);

    List<String> selectIp();

    void updateByIp(@Param("s") String s, @Param("addr1") String addr1);

    List<String> selectMemberIdByCash(@Param("start") LocalDateTime start,@Param("end") LocalDateTime now);

    List<StatisticsRecord> todayAllCashMoneyAppStore(@Param("star") LocalDateTime star,@Param("end") LocalDateTime end);
}